@echo off

Set BaseDir=%~d0%~p0..

SET BinDir=%BaseDir%\bin\Debug

SET IdlName=TextGen.idl
SET IdlPath=%BinDir%\%IdlName%
SET TlbName=TextGen.tlb
SET TlbPath=%BinDir%\%TlbName%
DEL TlbPath	REM delete original file
ECHO INFO: Recreating TypeLib from %IdlName%
CALL "%programfiles(x86)%\Microsoft Visual Studio 10.0\vc\bin\vcvars32.bat"
"%ProgramFiles(x86)%\Microsoft SDKs\Windows\v7.0A\bin\midl.exe" "%IdlPath%" /out "%BinDir%"

pause